﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Reward.master" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="SY.WebSite.Web.Reward.Index" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title><% if (My){ %>我的悬赏 - <%} %>悬赏系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/skin/default/main.css" rel="stylesheet" type="text/css" />
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/jquery.ui.uapselector.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" Runat="Server">
<%--<dl class="sub-nav">
  <dt>状态：</dt>
  <dd class="active"><a href="#">全部</a></dd>
  <dd><a href="#">悬赏中</a></dd>
  <dd><a href="#">悬赏结束</a></dd>
</dl>
--%>
    <p>
        状态：
        <label class="type"><input type="radio" name="type" value="100" checked="checked"/>&nbsp;全部</label>
        <label class="type"><input type="radio" name="type" value="0"/>&nbsp;悬赏中</label>
        <label ><input type="radio" name="type" value="1"/>&nbsp;悬赏结束</label>
        <label class="type">时间：</label><input id="start" type="text" class="Wdate date" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'end\')}'})"/>&nbsp; - &nbsp;<input id="end" type="text" class="Wdate date" onClick="WdatePicker({minDate:'#F{$dp.$D(\'start\')}'})"/>
    </p>
    <p>
        关键字：<input type="text" class="date" id="keyword" />
        <% if (!My){ %>
        发布人：<label type="text" class="date" id="userId" style="position: relative; top:11px;"></label>
            部门：<input type="text" class="date" id="deptName" />
        <% } %>
        <input type="button" class="small button" value="查询" onclick="page.query()" />
    </p>

    <div id="result"></div>
    <div id="pagination"></div>

    <textarea name="transaction" id="transaction" style="display:none;">        
        {for l in list}
            <div class="row">
                <div class="twelve columns">
                    <div class="panel">
                        <div class="row">
                            <div class="nine columns">
                                <label class="title"><a href="<% if (My){%>Review<% } else{%>Detail<%} %>.aspx?id=@{l.Id}" target="_blank"><strong>@{l.Title}</strong></a></label>
                            </div>
                            <div class="three columns right" style="text-align:right">
                                <label class="inline" style="margin-bottom:3px">悬赏素币：@{l.Amount}</label>
                            </div>
                        </div>
                        <div style="word-wrap: break-word;">
                            <p>@{l.Summary}</p>
                        </div>
                        <div>
                            发起人：@{l.UserName}&nbsp;&nbsp;截止时间：@{l.EndTime.ToDate().Format("yyyy-MM-dd hh:mm")}
                        </div>
                    </div>
                </div>
            </div>
        {forelse}
            <div class="row">
                <div class="twelve columns">
                    <div class="panel">
                        暂无相关悬赏
                    </div>
                </div>
            </div>
        {/for}
    </textarea>
    
    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/reward/index.js" type="text/javascript"></script>
    <script type="text/javascript">
    <% if (!My){ %>
        page.userList =<%= ToJson(UserList) %>;
    <% }else{ %>
        page.my = true;
    <% } %>
        page.queryUserId = "<%= Request.QueryString["userId"] %>";
    </script>
</asp:Content>